package com.sls.web.manager.action.recharge;

import javax.annotation.Resource;

import com.sls.web.manager.action.SuperAction;
import com.sls.web.manager.common.Constants;
import com.sls.web.manager.page.Pagination;
import com.sls.web.manager.recharge.pojo.SupplierLog;
import com.sls.web.manager.recharge.querybean.SupplierLogQuery;
import com.sls.web.manager.recharge.service.SupplierLogService;

public class SupplierLogAction extends SuperAction {
	private static final long serialVersionUID = 7039471396012254950L;
	@Resource(name = "supplierLogService")
	private SupplierLogService supplierLogService;
	/**
	 * 返回分页对象
	 */
	public Pagination<?> page;
	private SupplierLogQuery supplierLogQuery;
	private SupplierLog supplierLog;
	private String id;

	public Pagination<?> getPage() {
		return page;
	}

	public void setPage(Pagination<?> page) {
		this.page = page;
	}

	public SupplierLogQuery getSupplierLogQuery() {
		return supplierLogQuery;
	}

	public void setSupplierLogQuery(SupplierLogQuery supplierLogQuery) {
		this.supplierLogQuery = supplierLogQuery;
	}

	public SupplierLog getSupplierLog() {
		return supplierLog;
	}

	public void setSupplierLog(SupplierLog supplierLog) {
		this.supplierLog = supplierLog;
	}
	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	// 列表
	public String list() {
		if (supplierLogQuery == null) {
			supplierLogQuery = new SupplierLogQuery();
			supplierLogQuery.setPageSize(Constants.INIT_PAGESIZE);
			supplierLogQuery.setCurrentPage(Constants.INIT_CURRENTPAGE);
		}
		try {
			supplierLogQuery.setSupplierId(id);
			page = supplierLogService.querySupplierLog(supplierLogQuery,
					getCurrentOperator());
		} catch (Exception e) {
			return ERROR;
		}

		return "list";
	}
}